﻿
@{ Layout = "~/Views/Shared/_leftPanelLayout.cshtml";}
@section LeftTree
{
     
    @{
        Html.RenderPartial("DeptTreePartialView", new Webcar.Models.DeptTreeMode { Action = "CostList", Controller = "Car", ShowChild = false });
     }
}

@using (Ajax.BeginForm("CostListPartialView", "Car",Html.ViewContext.RouteData.Values, new AjaxOptions
    {
        HttpMethod = "POST",
        UpdateTargetId = "list-car",
        //OnBegin = "function{ showLoading();}",
        //OnComplete = "function(){ alert('sdsdsd'); }",
        InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace
    }))
    { 
        @UserQuery.CreateQuery(setting => {
       setting.QueryKey = QuerySettings.CarCostList;
           setting.Columns.Add(new QueryColumn() { Field = "record_no", Name = "牌照号" });
               setting.Columns.Add(new QueryColumn() { Field = "month", Name = "月份"});
               setting.Columns.Add(new QueryColumn() { Field = "sum_fee", Name = "总费用" });
        })
}
<div id="list-car">
    
    @Html.Action("CostListPartialView")
</div>
<hr />
 @Html.DevExpress().Button(settings =>
{
    settings.Name = "Button1";
    settings.Text = "增加单车成本";
    settings.Width = 120;
    settings.ControlStyle.CssClass = "button1";
    settings.ClientSideEvents.Click = "function(s, e){ location.href='" + @Url.Action("CostEdit", "Car") + "' }";
}).GetHtml()
